/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       alignment_relationship.cpp

	$Header: /game/alignment_relationship.cpp $

	$NoKeywords: $

 ************************************************************************/

// kill the 255+ character identifier warning.  Templates tend to exceed that easily.
#include "precompiled.h"
#pragma warning( disable: 4786 )

#include "alignment_relationship.h"

#include "town_type.h"

t_alignment_relationship get_alignment_relationship( t_town_type left, t_town_type right )
{
	if (left == right)
		return k_alignments_identical;

	if (left == k_town_might || right == k_town_might)
		return k_alignments_neutral;

	int difference = ( left - right + k_town_might ) % k_town_might;

	if (difference == 1 || difference == k_town_might - 1)
		return k_alignments_allied;

	return k_alignments_hostile;
}
